<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
	table{
		background-image: url(cao.png);
		background-size: 100% 100%;
		
	}	
	table td{
		width: 200px;
		height: 200px;
	}
	table td img{
		width: 100%;
		height: 100%;
	}
</style>
</head>
<script>
	var deal=0;
	 var mouses=document.getElementsByTagName("img");
	console.log(mouses);
	var num;
	setTimeout("maochulai()",Math.random()*400+800);
	
	function maochulai()
	{
		num=Math.floor(Math.random()*9);
		mouses[num].src="ken.png";
		mouses[num].setAttribute("onclick","da()");
		setTimeout("run()",Math.random()*400+800);
	}
	console.log(num);
	console.log(mouses[num]);
	function da(){
		mouses[num].src="ken-2.png";
		mouses[num].removeAttribute("onclick");
		deal+=1;
		document.getElementById("shulian").innerHTML="打死了"+deal+"只老鼠！！！！";
	}
	function run(){
		mouses[num].src="ken-1.png";
		mouses[num].removeAttribute("onclick");
		setTimeout("maochulai()",Math.random()*400+800);
		
	}
</script>
<body style="background-color: #E8CDCE">
<center>
<h1 id="shulian">打了的老鼠数量</h1>
<table>
<caption style="font-size: 50px; color:#000000">打地鼠</caption>
	<tr>
		<td><img src="ken-1.png"/></td>
		<td><img src="ken-1.png"/></td>
		<td><img src="ken-1.png"/></td>
	</tr>
	<tr>
		<td><img src="ken-1.png"/></td>
		<td><img src="ken-1.png"/></td>
		<td><img src="ken-1.png"/></td>
	</tr>
	<tr>
		<td><img src="ken-1.png"/></td>
		<td><img src="ken-1.png"/></td>
		<td><img src="ken-1.png"/></td>
	</tr>
</table>
</center>
</body>
</html>
